import pygame
import pygame_gui


manager = pygame_gui.UIManager((1920, 1080), './theme.json')

background = pygame.Surface((1920, 1080))
background.fill(manager.get_theme().get_colour('dark_bg'))

button_row_width = 400
button_row_height = 160
zx,zy = 70, 17
zx1,zy1 = 70,720

position1 = (zx, zy)
button1 = pygame_gui.elements.UIButton(relative_rect=pygame.Rect(position1,
                                                               (button_row_width,
                                                                button_row_height)),
                                     text = "stp_moto_1",
                                     manager=manager,
                                     object_id='#1')
position2 = (zx, zy + button_row_height + 17)
button2 = pygame_gui.elements.UIButton(relative_rect=pygame.Rect(position2,
                                                               (button_row_width,
                                                                button_row_height)),
                                     text = "stp_moto_2",
                                     manager=manager,
                                     object_id='#2')
position3 = (zx + button_row_width + 160 // 3, zy)
button3 = pygame_gui.elements.UIButton(relative_rect=pygame.Rect(position3,
                                                               (button_row_width,
                                                                button_row_height)),
                                     text = "DC_moto_1",
                                     manager=manager,
                                     object_id='#3')
position4 = (zx + button_row_width + 160 // 3, zy + button_row_height + 17)
button4 = pygame_gui.elements.UIButton(relative_rect=pygame.Rect(position4,
                                                               (button_row_width,
                                                                button_row_height)),
                                     text = "DC_moto_2",
                                     manager=manager,
                                     object_id='#4')
position5 = (zx + (button_row_width + 160 // 3) * 2, zy )
button5 = pygame_gui.elements.UIButton(relative_rect=pygame.Rect(position5,
                                                               (button_row_width,
                                                                button_row_height)),
                                     text = "DC_moto_3",
                                     manager=manager,
                                     object_id='#5')
position6 = (zx + (button_row_width + 160 // 3) * 2, zy + button_row_height + 17)
button6 = pygame_gui.elements.UIButton(relative_rect=pygame.Rect(position6,
                                                               (button_row_width,
                                                                button_row_height)),
                                     text = "DC_moto_4",
                                     manager=manager,
                                     object_id='#6')
position7 = (zx + (button_row_width + 160 // 3) * 3, zy )
button7 = pygame_gui.elements.UIButton(relative_rect=pygame.Rect(position7,
                                                               (button_row_width,
                                                                button_row_height)),
                                     text = "ele_moto_1",
                                     manager=manager,
                                     object_id='#7')
position8 = (zx + (button_row_width + 160 // 3) * 3, zy + button_row_height + 17)
button8 = pygame_gui.elements.UIButton(relative_rect=pygame.Rect(position8,
                                                               (button_row_width,
                                                                button_row_height)),
                                     text = "ele_moto_2",
                                     manager=manager,
                                     object_id='#8')
position9 = (zx1, zy1)
button1_1 = pygame_gui.elements.UIButton(relative_rect=pygame.Rect(position9,
                                                               (button_row_width,
                                                                button_row_height)),
                                     text = "stp_moto_1",
                                     manager=manager,
                                     object_id='#1')
position10 = (zx1, zy1 + button_row_height + 17)
button2_1 = pygame_gui.elements.UIButton(relative_rect=pygame.Rect(position10,
                                                               (button_row_width,
                                                                button_row_height)),
                                     text = "stp_moto_2",
                                     manager=manager,
                                     object_id='#2')
position11 = (zx1 + button_row_width + 160 // 3, zy1)
button3_1 = pygame_gui.elements.UIButton(relative_rect=pygame.Rect(position11,
                                                               (button_row_width,
                                                                button_row_height)),
                                     text = "DC_moto_1",
                                     manager=manager,
                                     object_id='#3')
position12 = (zx1 + button_row_width + 160 // 3, zy1 + button_row_height + 17)
button4_1 = pygame_gui.elements.UIButton(relative_rect=pygame.Rect(position12,
                                                               (button_row_width,
                                                                button_row_height)),
                                     text = "DC_moto_2",
                                     manager=manager,
                                     object_id='#4')
position13 = (zx1 + (button_row_width + 160 // 3) * 2, zy1 )
button5_1 = pygame_gui.elements.UIButton(relative_rect=pygame.Rect(position13,
                                                               (button_row_width,
                                                                button_row_height)),
                                     text = "DC_moto_3",
                                     manager=manager,
                                     object_id='#5')
position14 = (zx1 + (button_row_width + 160 // 3) * 2, zy1 + button_row_height + 17)
button6_1 = pygame_gui.elements.UIButton(relative_rect=pygame.Rect(position14,
                                                               (button_row_width,
                                                                button_row_height)),
                                     text = "DC_moto_4",
                                     manager=manager,
                                     object_id='#6')
position15 = (zx1 + (button_row_width + 160 // 3) * 3, zy1 )
button7_1 = pygame_gui.elements.UIButton(relative_rect=pygame.Rect(position15,
                                                               (button_row_width,
                                                                button_row_height)),
                                     text = "ele_moto_1",
                                     manager=manager,
                                     object_id='#7')
position16 = (zx1 + (button_row_width + 160 // 3) * 3, zy1 + button_row_height + 17)
button8_1 = pygame_gui.elements.UIButton(relative_rect=pygame.Rect(position16,
                                                               (button_row_width,
                                                                button_row_height)),
                                     text = "ele_moto_2",
                                     manager=manager,
                                     object_id='#8')
position17 = (zx, 371)
button17 = pygame_gui.elements.UIButton(relative_rect=pygame.Rect(position17,
                                                               (button_row_width,
                                                                button_row_height)),
                                     text = "spd+",
                                     manager=manager,
                                     object_id='#9')
position18 = (zx, 548)
button18 = pygame_gui.elements.UIButton(relative_rect=pygame.Rect(position18,
                                                               (button_row_width,
                                                                button_row_height)),
                                     text = "spd-",
                                     manager=manager,
                                     object_id='#9')
position19 = (1920 / 2 - button_row_width /2 , 371)
button119 = pygame_gui.elements.UIButton(relative_rect=pygame.Rect(position19,
                                                               (button_row_width,
                                                                button_row_height)),
                                     text = "run+",
                                     manager=manager,
                                     object_id='#10')
position20 = (1920 / 2 - button_row_width /2, 548)
button20 = pygame_gui.elements.UIButton(relative_rect=pygame.Rect(position20,
                                                               (button_row_width,
                                                                button_row_height)),
                                     text = "run-",
                                     manager=manager,
                                     object_id='#10')
position21 = (zx + (button_row_width + 160 // 3) * 3, 371)
button21 = pygame_gui.elements.UIButton(relative_rect=pygame.Rect(position21,
                                                               (button_row_width,
                                                                button_row_height)),
                                     text = "up",
                                     manager=manager,
                                     object_id='#11')
position22 = (zx + (button_row_width + 160 // 3) * 3, 548)
button22 = pygame_gui.elements.UIButton(relative_rect=pygame.Rect(position22,
                                                               (button_row_width,
                                                                button_row_height)),
                                     text = "down",
                                     manager=manager,
                                     object_id='#11')